class FilterChain:
    def __init__(self):
        self.head = None

    def add_filter(self, new_filter):
        if not self.head:
            self.head = new_filter
        else:
            current = self.head
            while current.next_filter:
                current = current.next_filter
            current.next_filter = new_filter

    def process(self, data):
        if self.head:
            return self.head.process(data)
        return data
